package com.dzu.easy;

/**
 * @author ZhaoDong
 * @date 2022/9/27 10:49
 * @description 344. 反转字符串
 */
public class Test344 {

    public static void main(String[] args) {

        char[] arr = new char[]{'h', 'e', 'l', 'l', 'o'};
        reverseString(arr);
        System.out.println(arr);
    }


    public static void reverseString(char[] s) {
        int start = 0;
        int end = s.length - 1;
        while (end > start) {
           char temp =  s[end];
            s[end] = s[start];
            s[start] = temp;

            start++;
            end--;
        }

    }
}
